#include <stdio.h>
#include <math.h>
int main()
{
    int i = 1;
    double sum = 1.0;
    double flag = 1.0;
    while ((1.0 / i) >= 0.000001f)
    {
        i = i + 2;
        sum = pow(-1, flag) * (1.0 / i) + sum;
        flag += 1;
    }
    sum = sum * 4;
    printf("pi=%10.4f", sum);
    return 0;
}